<?php

declare(strict_types=1);
/**
 * This file is part of Hyperf.
 *
 * @link     https://www.hyperf.io
 * @document https://hyperf.wiki
 * @contact  group@hyperf.io
 * @license  https://github.com/hyperf/hyperf/blob/master/LICENSE
 */
namespace App\Exception;

use Hyperf\Server\Exception\ServerException;

class BusinessException extends ServerException
{
    public function __construct(string $message = null, \Throwable $previous = null)
    {
        $code = (int) strstr($message, '_', true);
        $msg = str_replace('_', '', strstr($message, '_'));

        parent::__construct($msg, $code, $previous);
    }
}
